package com.acme.domain.account;

import com.acme.exceptions.NotEnoughFundsException;

public abstract class AbstractAccount implements Account{

	protected int id;
	protected double balance;
	AbstractAccount(final double amount) {
		if ( amount < 0 ){
			throw new IllegalArgumentException("amount");
		}
		this.balance = amount;
	}
	public double getBalance() {
		return balance;
	}

	public void deposit(final double amount) {
		this.balance+=amount;
	}

	public abstract void withdraw(final double amount) throws NotEnoughFundsException;

}
